package com.fusetech.flow.audit.service.mapstruct;


import com.fusetech.flow.audit.domain.AuditNodeAuditor;
import com.fusetech.flow.audit.service.dto.AuditNodeAuditorDTO;
import com.fusetech.os.core.mapstruct.EntityWrapper;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 *  AuditNodeAuditorWrapper
 * @author Liuwq
 * @version 2023-05-08
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {} )
public interface AuditNodeAuditorWrapper extends EntityWrapper<AuditNodeAuditorDTO, AuditNodeAuditor> {

    AuditNodeAuditorWrapper INSTANCE = Mappers.getMapper(AuditNodeAuditorWrapper.class);
     @Mappings({
            @Mapping(source = "createBy.userId", target = "createBy"),
            @Mapping (source = "updateBy.userId", target = "updateBy")})
    AuditNodeAuditor toEntity(AuditNodeAuditorDTO dto);


    @Mappings({
            @Mapping (source = "createBy", target = "createBy.userId"),
            @Mapping (source = "updateBy", target = "updateBy.userId")})
    AuditNodeAuditorDTO toDTO(AuditNodeAuditor entity);
}

